home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / AEObjects.a < prev    next >
Text File  |  1996-05-01  |  13KB  |  402 lines

  1. ;
  2. ;    File:        AEObjects.a
  3. ;
  4. ;    Contains:    Object Support Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 8
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__AEOBJECTS__') = 'UNDEFINED' THEN
  19. __AEOBJECTS__ SET 1
  20.  
  21.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  22.     include 'OSUtils.a'
  23.     ENDIF
  24.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  25.     include 'Quickdraw.a'
  26.     ENDIF
  27.     IF &TYPE('__EPPC__') = 'UNDEFINED' THEN
  28.     include 'EPPC.a'
  29.     ENDIF
  30.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  31.     include 'AppleEvents.a'
  32.     ENDIF
  33.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  34.     include 'Errors.a'
  35.     ENDIF
  36.     IF FOR_SYSTEM7_ONLY THEN
  37.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  38.     include 'Memory.a'
  39.     ENDIF
  40.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  41.     include 'Events.a'
  42.     ENDIF
  43.     ENDIF
  44. ; ***    LOGICAL OPERATOR CONSTANTS    ***
  45.  
  46. kAEAND                            EQU        'AND '                ;  0x414e4420  
  47. kAEOR                            EQU        'OR  '                ;  0x4f522020  
  48. kAENOT                            EQU        'NOT '                ;  0x4e4f5420  
  49.                                                             ;***    ABSOLUTE ORDINAL CONSTANTS    ***
  50. kAEFirst                        EQU        'firs'                ;  0x66697273  
  51. kAELast                            EQU        'last'                ;  0x6c617374  
  52. kAEMiddle                        EQU        'midd'                ;  0x6d696464  
  53. kAEAny                            EQU        'any '                ;  0x616e7920  
  54. kAEAll                            EQU        'all '                ;  0x616c6c20  
  55.                                                             ;***    RELATIVE ORDINAL CONSTANTS    ***
  56. kAENext                            EQU        'next'                ;  0x6e657874  
  57. kAEPrevious                        EQU        'prev'                ;  0x70726576  
  58.                                                             ;***    KEYWORD CONSTANT     ***
  59. keyAECompOperator                EQU        'relo'                ;  0x72656c6f  
  60. keyAELogicalTerms                EQU        'term'                ;  0x7465726d  
  61. keyAELogicalOperator            EQU        'logc'                ;  0x6c6f6763  
  62. keyAEObject1                    EQU        'obj1'                ;  0x6f626a31  
  63. keyAEObject2                    EQU        'obj2'                ;  0x6f626a32  
  64.                                                             ;    ... for Keywords for getting fields out of object specifier records. 
  65. keyAEDesiredClass                EQU        'want'                ;  0x77616e74  
  66. keyAEContainer                    EQU        'from'                ;  0x66726f6d  
  67. keyAEKeyForm                    EQU        'form'                ;  0x666f726d  
  68. keyAEKeyData                    EQU        'seld'                ;  0x73656c64  
  69.  
  70.                                                             ;    ... for Keywords for getting fields out of Range specifier records. 
  71. keyAERangeStart                    EQU        'star'                ;  0x73746172  
  72. keyAERangeStop                    EQU        'stop'                ;  0x73746f70  
  73.                                                             ;    ... special handler selectors for OSL Callbacks. 
  74. keyDisposeTokenProc                EQU        'xtok'                ;  0x78746f6b  
  75. keyAECompareProc                EQU        'cmpr'                ;  0x636d7072  
  76. keyAECountProc                    EQU        'cont'                ;  0x636f6e74  
  77. keyAEMarkTokenProc                EQU        'mkid'                ;  0x6d6b6964  
  78. keyAEMarkProc                    EQU        'mark'                ;  0x6d61726b  
  79. keyAEAdjustMarksProc            EQU        'adjm'                ;  0x61646a6d  
  80. keyAEGetErrDescProc                EQU        'indc'                ;  0x696e6463  
  81. ; ***    VALUE and TYPE CONSTANTS    ***
  82.  
  83.                                                             ;    ... possible values for the keyAEKeyForm field of an object specifier. 
  84. formAbsolutePosition            EQU        'indx'                ;  0x696e6478  
  85. formRelativePosition            EQU        'rele'                ;  0x72656c65  
  86. formTest                        EQU        'test'                ;  0x74657374  
  87. formRange                        EQU        'rang'                ;  0x72616e67  
  88. formPropertyID                    EQU        'prop'                ;  0x70726f70  
  89. formName                        EQU        'name'                ;  0x6e616d65  
  90.                                                             ;    ... relevant types (some of these are often pared with forms above). 
  91. typeObjectSpecifier                EQU        'obj '                ;  0x6f626a20  
  92. typeObjectBeingExamined            EQU        'exmn'                ;  0x65786d6e  
  93. typeCurrentContainer            EQU        'ccnt'                ;  0x63636e74  
  94. typeToken                        EQU        'toke'                ;  0x746f6b65  
  95. typeRelativeDescriptor            EQU        'rel '                ;  0x72656c20  
  96. typeAbsoluteOrdinal                EQU        'abso'                ;  0x6162736f  
  97. typeIndexDescriptor                EQU        'inde'                ;  0x696e6465  
  98. typeRangeDescriptor                EQU        'rang'                ;  0x72616e67  
  99. typeLogicalDescriptor            EQU        'logi'                ;  0x6c6f6769  
  100. typeCompDescriptor                EQU        'cmpd'                ;  0x636d7064  
  101. typeOSLTokenList                EQU        'ostl'                ;  0x6F73746C  
  102. ;  Possible values for flags parameter to AEResolve.  They're additive 
  103.  
  104. kAEIDoMinimum                    EQU        $0000
  105. kAEIDoWhose                        EQU        $0001
  106. kAEIDoMarking                    EQU        $0004
  107. kAEPassSubDescs                    EQU        $0008
  108. kAEResolveNestedLists            EQU        $0010
  109. kAEHandleSimpleRanges            EQU        $0020
  110. kAEUseRelativeIterators            EQU        $0040
  111. ; *** SPECIAL CONSTANTS FOR CUSTOM WHOSE-CLAUSE RESOLUTION 
  112.  
  113. typeWhoseDescriptor                EQU        'whos'                ;  0x77686f73  
  114. formWhose                        EQU        'whos'                ;  0x77686f73  
  115. typeWhoseRange                    EQU        'wrng'                ;  0x77726e67  
  116. keyAEWhoseRangeStart            EQU        'wstr'                ;  0x77737472  
  117. keyAEWhoseRangeStop                EQU        'wstp'                ;  0x77737470  
  118. keyAEIndex                        EQU        'kidx'                ;  0x6b696478  
  119. keyAETest                        EQU        'ktst'                ;  0x6b747374  
  120. ;
  121. ;*
  122. ;    used for rewriting tokens in place of 'ccnt' descriptors
  123. ;    This record is only of interest to those who, when they...
  124. ;    ...get ranges as key data in their accessor procs, choose
  125. ;    ...to resolve them manually rather than call AEResolve again.
  126. ;*
  127. ;
  128. ccntTokenRecord            RECORD 0
  129. tokenClass                 ds.l    1                ; offset: $0 (0)
  130. token                     ds        AEDesc            ; offset: $4 (4)
  131. sizeof                     EQU *                    ; size:   $C (12)
  132.                         ENDR
  133. ; typedef struct ccntTokenRecord *        ccntTokenRecPtr
  134.  
  135. ; typedef ccntTokenRecPtr *                ccntTokenRecHandle
  136.  
  137.     IF OLDROUTINENAMES THEN
  138. ; typedef struct AEDesc *                DescPtr
  139.  
  140. ; typedef DescPtr *                        DescHandle
  141.  
  142.     ENDIF
  143.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  144.     IF FOR_PTR_BASED_AE THEN
  145. OSLToken                RECORD 0
  146. f                         ds        AEDesc
  147. sizeof                     EQU *                    ; size:   $8 (8)
  148.                         ENDR
  149.  
  150.  
  151. ; typedef struct OSLToken *                OSLTokenPtr
  152.  
  153. OSLTokenList            RECORD 0
  154. f                         ds        AEDesc
  155. sizeof                     EQU *                    ; size:   $8 (8)
  156.                         ENDR
  157.  
  158.  
  159. ; typedef struct OSLTokenList *            OSLTokenListPtr
  160.  
  161. ;  typedefs providing type checking for procedure pointers 
  162. ;  these typedefs must be the same as the system 7 ones 
  163. ;  the system 7 and system 8 callbacks can intermingle 
  164. ; -------------------------------------------------------------- PUBLIC PROCEDURES ------------------------------------------------------------------
  165. ;
  166. ; extern OSStatus AESetObjectCallbacks(OSLCompareProcPtr myCompareProc, OSLCountProcPtr myCountProc, OSLDisposeTokenProcPtr myDisposeTokenProc, OSLGetMarkTokenProcPtr myGetMarkTokenProc, OSLMarkProcPtr myMarkProc, OSLAdjustMarksProcPtr myAdjustMarksProc, OSLGetErrDescProcPtr myGetErrDescProcPtr)
  167. ;
  168.     IF GENERATINGCFM THEN
  169.         IMPORT_CFM_FUNCTION AESetObjectCallbacks
  170.     ENDIF
  171.  
  172. ;
  173. ; extern OSStatus AEResolve(const AEDesc *objectSpecifier, SInt16 callbackFlags, AEDesc *theToken)
  174. ;
  175.     IF GENERATINGCFM THEN
  176.         IMPORT_CFM_FUNCTION AEResolve
  177.     ENDIF
  178.  
  179. ;
  180. ; extern OSStatus AEInstallObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorProcPtr theAccessor, void *accessorRefcon, Boolean isSysHandler)
  181. ;
  182.     IF GENERATINGCFM THEN
  183.         IMPORT_CFM_FUNCTION AEInstallObjectAccessor
  184.     ENDIF
  185.  
  186. ;
  187. ; extern OSStatus AERemoveObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorProcPtr theAccessor, Boolean isSysHandler)
  188. ;
  189.     IF GENERATINGCFM THEN
  190.         IMPORT_CFM_FUNCTION AERemoveObjectAccessor
  191.     ENDIF
  192.  
  193. ;
  194. ; extern OSStatus AEGetObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorProcPtr *accessor, void **accessorRefcon, Boolean isSysHandler)
  195. ;
  196.     IF GENERATINGCFM THEN
  197.         IMPORT_CFM_FUNCTION AEGetObjectAccessor
  198.     ENDIF
  199.  
  200. ;
  201. ; extern OSStatus AEDisposeToken(AEDesc *theToken)
  202. ;
  203.     IF GENERATINGCFM THEN
  204.         IMPORT_CFM_FUNCTION AEDisposeToken
  205.     ENDIF
  206.  
  207. ;
  208. ; extern OSStatus AECallObjectAccessor(DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *token)
  209. ;
  210.     IF GENERATINGCFM THEN
  211.         IMPORT_CFM_FUNCTION AECallObjectAccessor
  212.     ENDIF
  213.  
  214. ;  new API 
  215. ;
  216. ; extern OSStatus AECreateTokenList(OSLTokenListPtr resultList)
  217. ;
  218.     IF GENERATINGCFM THEN
  219.         IMPORT_CFM_FUNCTION AECreateTokenList
  220.     ENDIF
  221.  
  222. ;
  223. ; extern OSStatus AEAppendToTokenList(OSLTokenListPtr theTokenList, const AEDesc *addToken)
  224. ;
  225.     IF GENERATINGCFM THEN
  226.         IMPORT_CFM_FUNCTION AEAppendToTokenList
  227.     ENDIF
  228.  
  229. ;
  230. ; extern OSStatus AETokenCount(const OSLTokenList *theTokenList, ItemCount *theCount)
  231. ;
  232.     IF GENERATINGCFM THEN
  233.         IMPORT_CFM_FUNCTION AETokenCount
  234.     ENDIF
  235.  
  236. ;
  237. ; extern OSStatus AEGetNthToken(const OSLTokenList *theTokenList, ItemCount index, OSLTokenPtr resultToken)
  238. ;
  239.     IF GENERATINGCFM THEN
  240.         IMPORT_CFM_FUNCTION AEGetNthToken
  241.     ENDIF
  242.  
  243. ;
  244. ; extern OSStatus AEPruneTokenList(ItemCount keepStart, ItemCount keepEnd, OSLTokenListPtr theTokenList)
  245. ;
  246.     IF GENERATINGCFM THEN
  247.         IMPORT_CFM_FUNCTION AEPruneTokenList
  248.     ENDIF
  249.  
  250. ;
  251. ; extern OSStatus AECallObjectAccessorWithFlags(DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, SInt16 callBackFlags, AEDesc *token)
  252. ;
  253.     IF GENERATINGCFM THEN
  254.         IMPORT_CFM_FUNCTION AECallObjectAccessorWithFlags
  255.     ENDIF
  256.  
  257. ;
  258. ; extern OSStatus AEResolveSubDesc(const AESubDesc *objectSpecifier, SInt16 callBackFlags, AEDesc *theToken)
  259. ;
  260.     IF GENERATINGCFM THEN
  261.         IMPORT_CFM_FUNCTION AEResolveSubDesc
  262.     ENDIF
  263.  
  264. ;
  265. ; extern OSStatus AEInstallObjectCallback(AEKeyword functionClass, ProcPtr handler)
  266. ;
  267.     IF GENERATINGCFM THEN
  268.         IMPORT_CFM_FUNCTION AEInstallObjectCallback
  269.     ENDIF
  270.  
  271. ;
  272. ; extern OSStatus AERemoveObjectCallback(AEKeyword functionClass, ProcPtr handler)
  273. ;
  274.     IF GENERATINGCFM THEN
  275.         IMPORT_CFM_FUNCTION AERemoveObjectCallback
  276.     ENDIF
  277.  
  278. ;
  279. ; extern OSStatus AEGetObjectCallback(AEKeyword functionClass, ProcPtr *handler)
  280. ;
  281.     IF GENERATINGCFM THEN
  282.         IMPORT_CFM_FUNCTION AEGetObjectCallback
  283.     ENDIF
  284.  
  285.     ENDIF
  286.     ENDIF
  287.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  288.     IF ¨ FOR_PTR_BASED_AE THEN
  289. ;  typedefs providing type checking for procedure pointers 
  290. ; -------------------------------------------------------------- PUBLIC PROCEDURES ------------------------------------------------------------------
  291. ;
  292. ; pascal OSErr AEObjectInit(void )
  293. ;
  294.     IF GENERATINGCFM THEN
  295.         IMPORT_CFM_FUNCTION AEObjectInit
  296.     ENDIF
  297.  
  298. ;
  299. ; Not done by inline, but by direct linking into code.  It sets up the pack
  300. ;  such that further calls can be via inline 
  301. ;
  302. ;
  303. ; pascal OSErr AESetObjectCallbacks(OSLCompareUPP myCompareProc, OSLCountUPP myCountProc, OSLDisposeTokenUPP myDisposeTokenProc, OSLGetMarkTokenUPP myGetMarkTokenProc, OSLMarkUPP myMarkProc, OSLAdjustMarksUPP myAdjustMarksProc, OSLGetErrDescUPP myGetErrDescProcPtr)
  304. ;
  305.     IF ¨ GENERATINGCFM THEN
  306.         Macro
  307.         _AESetObjectCallbacks
  308.             move.w              #$0E35,D0
  309.             dc.w                $A816
  310.         EndM
  311.     ELSE
  312.         IMPORT_CFM_FUNCTION AESetObjectCallbacks
  313.     ENDIF
  314.  
  315. ;
  316. ; pascal OSErr AEResolve(const AEDesc *objectSpecifier, short callbackFlags, AEDesc *theToken)
  317. ;
  318.     IF ¨ GENERATINGCFM THEN
  319.         Macro
  320.         _AEResolve
  321.             move.w              #$0536,D0
  322.             dc.w                $A816
  323.         EndM
  324.     ELSE
  325.         IMPORT_CFM_FUNCTION AEResolve
  326.     ENDIF
  327.  
  328. ;
  329. ; pascal OSErr AEInstallObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorUPP theAccessor, long accessorRefcon, Boolean isSysHandler)
  330. ;
  331.     IF ¨ GENERATINGCFM THEN
  332.         Macro
  333.         _AEInstallObjectAccessor
  334.             move.w              #$0937,D0
  335.             dc.w                $A816
  336.         EndM
  337.     ELSE
  338.         IMPORT_CFM_FUNCTION AEInstallObjectAccessor
  339.     ENDIF
  340.  
  341. ;
  342. ; pascal OSErr AERemoveObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorUPP theAccessor, Boolean isSysHandler)
  343. ;
  344.     IF ¨ GENERATINGCFM THEN
  345.         Macro
  346.         _AERemoveObjectAccessor
  347.             move.w              #$0738,D0
  348.             dc.w                $A816
  349.         EndM
  350.     ELSE
  351.         IMPORT_CFM_FUNCTION AERemoveObjectAccessor
  352.     ENDIF
  353.  
  354. ;
  355. ; pascal OSErr AEGetObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorUPP *accessor, long *accessorRefcon, Boolean isSysHandler)
  356. ;
  357.     IF ¨ GENERATINGCFM THEN
  358.         Macro
  359.         _AEGetObjectAccessor
  360.             move.w              #$0939,D0
  361.             dc.w                $A816
  362.         EndM
  363.     ELSE
  364.         IMPORT_CFM_FUNCTION AEGetObjectAccessor
  365.     ENDIF
  366.  
  367. ;
  368. ; pascal OSErr AEDisposeToken(AEDesc *theToken)
  369. ;
  370.     IF ¨ GENERATINGCFM THEN
  371.         Macro
  372.         _AEDisposeToken
  373.             move.w              #$023A,D0
  374.             dc.w                $A816
  375.         EndM
  376.     ELSE
  377.         IMPORT_CFM_FUNCTION AEDisposeToken
  378.     ENDIF
  379.  
  380. ;
  381. ; pascal OSErr AECallObjectAccessor(DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *token)
  382. ;
  383.     IF ¨ GENERATINGCFM THEN
  384.         Macro
  385.         _AECallObjectAccessor
  386.             move.w              #$0C3B,D0
  387.             dc.w                $A816
  388.         EndM
  389.     ELSE
  390.         IMPORT_CFM_FUNCTION AECallObjectAccessor
  391.     ENDIF
  392.  
  393.     ENDIF
  394.     ENDIF
  395. ; -------------------------------------------------------------- END PUBLIC PROCEDURES -------------------------------------------------------
  396. ; -------------------------------------------------------------------------------------------------------------------------------------------------
  397. ;   NOTE: To check for the presence of the Object Support Library on PowerPC, use    
  398. ;     the Gestalt selector, gestaltOSLInSystem, which is defined in Gestalt.h/p/a.    
  399. ; -------------------------------------------------------------------------------------------------------------------------------------------------
  400.     ENDIF ; __AEOBJECTS__ 
  401.  
  402.